<%--
    Document   : login
    Created on : 20.4.2009, 19:26:35
    Author     : Ediczech
--%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<h2><h:outputText value="#{msg.login_title}"/></h2>

<h:panelGroup rendered="#{ApplicationBean.isLogged}">
    <h:outputText value="#{msg.login_welcome}: "/>
    <h:outputText value="#{LoginBean.username}"/><br/>
    <h:outputText value="#{LoginBean.userRole}"/><br/>
    <h:outputLink value="/bugman-war/faces/editProfile.jsp">
        <h:outputText value="#{msg.editProfile_link}" />
    </h:outputLink>
    <h:form>
        <h:commandButton value="#{msg.login_logout}" action="#{LoginBean.logout}"/><br/>
    </h:form>
</h:panelGroup>

<h:panelGroup rendered="#{!ApplicationBean.isLogged}">
    <form action="j_security_check" method="POST">
        <h:panelGrid>
            <h:outputText value="#{msg.login_name}"/>
            <h:inputText id="j_username" required="true" value="Ediczech" size="12">
                <f:validateLength minimum="3" maximum="12"  />
            </h:inputText>
            <h:message for="j_username" errorClass="message_error"/>

            <h:outputText value="#{msg.login_password}"/>
            <h:inputSecret id="j_password" required="true" size="12">
                <f:validateLength minimum="4" maximum="30"  />
            </h:inputSecret>
            <h:message for="j_password" errorClass="message_error"/>
        </h:panelGrid>
        <h:commandButton id="j_security_check" action="j_security_check" value="login"/>
    </form>
</h:panelGroup>